package metier;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Vector;

import jdbc.Connexion;
import metier.jdbc.grade.GradeJdbc;
import configuration.Constante;

public class Promotion {
	//ATTRIBUTS
	private Integer idEleve;
	private Integer idGrade;
	private java.util.Date datePromo;
	
	
	//CONSTRUCTEURS
	public Promotion(Integer idEleve, Integer idGrade, Date datePromo) {
		this.idEleve = idEleve;
		this.idGrade = idGrade;
		this.datePromo = datePromo;
	}
	
	//GETTERS et SETTERS
	public Integer getIdEleve() {
		return idEleve;
	}
	
	public void setIdEleve(Integer idEleve) {
		this.idEleve = idEleve;
	}
	
	public Integer getIdGrade() {
		return idGrade;
	}
	
	public void setIdGrade(Integer idGrade) {
		this.idGrade = idGrade;
	}
	
	public java.util.Date getDatePromo() {
		return datePromo;
	}
	
	public void setDatePromo(java.util.Date datePromo) {
		this.datePromo = datePromo;
	}	
	
	
	/**
	 * @return
	 */
	public Vector<Object> getVector(){
		Vector<Object> vector = new Vector<Object>();
		String libelle = GradeJdbc.getLibelleGradeById(Connexion.getConnexion(), this.idGrade);
		vector.add(libelle);
		
		SimpleDateFormat sdf = new SimpleDateFormat(Constante.FORMAT_DATE_SHORT);
		vector.add(sdf.format(this.getDatePromo()));
		
		return vector;
	}
	
}
